import * as actionType from "./constants.js";
import { reqmy } from "../../../api/index";

//我的my页面数据
export const changeMyData = (data) => {
  return {
    type: actionType.CHANGE_MYDATA,
    data: data,
  };
};

export const getMyData = () => {
  return (dispatch) => {
    reqmy()
      .then((res) => {
        dispatch(changeMyData(res.data.data));
      })
      .catch((e) => {
        console.log("出错了");
      });
  };
};
